import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Rectangle {
    width: 400
    height: 300
    color: "lightgray"

    MenuBar {
        width: parent.width

        Menu {
            title: "文件"
            MenuItem {
                text: "新建"
                onTriggered: console.log("新建文件")
            }
            Menu {
                title: "最近打开"
                MenuItem { text: "文档1" }
                MenuItem { text: "文档2" }
            }
            MenuSeparator { }
            MenuItem {
                text: "退出"
                onTriggered: Qt.quit()
            }
        }
    }
}
